<template>
  <span class="inline-flex justify-between">
    <span class="mr-2">{{ leader.userName }}</span>
    <!--    <el-tag-->
    <!--      v-if="leader.userName"-->
    <!--      size="small"-->
    <!--      :type="leader.leaderType === '1' ? 'success' : 'primary'"-->
    <!--    >-->
    <!--      <DictionaryShow-->
    <!--        parent-dictionary-value="leaderType"-->
    <!--        :value="leader.leaderType"-->
    <!--      />-->
    <!--    </el-tag>-->
  </span>
</template>

<script setup lang="ts">
import useLeaderStore from '@/stores/leader'
import { computed } from 'vue'

const { leaderId } = defineProps<{
  leaderId: number | undefined
}>()

const leader = computed(() => {
  if (leaderId) {
    return (
      leaderStore.list.find((item) => item.userId === leaderId) || {
        userName: null,
        leaderType: null,
      }
    )
  } else {
    return {
      userName: null,
      leaderType: null,
    }
  }
})

const leaderStore = useLeaderStore()
</script>

<style scoped lang="scss"></style>
